<!DOCTYPE html>
<html>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"> -->
  <title>Mapus地图协作</title>
  <!-- <link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.3/dist/leaflet.css"/> -->
  <!-- <link href="https://cdn.bootcdn.net/ajax/libs/leaflet/1.9.3/leaflet.min.css" rel="stylesheet"> -->
  <link rel="stylesheet" href="/static/supa-mapus/leaflet.css" />
  <link rel="stylesheet" href="/static/supa-mapus/styles.css" />
  <!-- <link rel="stylesheet" href="https://unpkg.com/@geoman-io/leaflet-geoman-free@latest/dist/leaflet-geoman.css"/> -shen4-->
  <link rel="stylesheet" href="/static/supa-mapus/leaflet-geoman.css" />
  <link rel="stylesheet" type="text/css" href="/static/supa-mapus/leaflet.measure.css"/>
  <!-- leaflet-elevation -->
  <!-- <link rel="stylesheet" href="https://unpkg.com/@raruto/leaflet-elevation@2.2.8/dist/leaflet-elevation.min.css"/> -->
  <link rel="stylesheet" href="/static/supa-mapus/leaflet-elevation.min.css" />
  <style type="text/css">
  .toggle-icon {
    top: 10px;
    left: 20px;
    position: fixed;
    z-index: 1000;
    display: flex;
    align-items: center;
    fill: currentColor;
    width: 30px;
    height: 30px;
    color: #666;
    cursor: pointer;
    transform: rotate(90deg);
  }

  .icon-mobile {
    width: 50px;
    height: 50px;
  }

  .hide {
    display: none;
  }

  .trans {
    animation: rotate .4s linear;
  }

  .trans-revert {
    animation: rotate-revert .4s linear;
    left: 258px;
    transform: rotate(0);
  }

  @keyframes rotate {
    0% {
      -webkit-transform: rotate(0deg);
    }

    100% {
      -webkit-transform: rotate(90deg);
    }
  }

  @keyframes rotate-revert {
    0% {
      -webkit-transform: rotate(90deg);
    }

    100% {
      -webkit-transform: rotate(0deg);
    }
  }
  </style>
</head>

<body style="margin:0px;">
  <div id="share">
    <div id="share-nav">
      <span>Share Cool Map</span>
      <img src="/static/supa-mapus/assets/close-button.svg" id="close-share">
    </div>
    <input value="https://coollink.com/haha" id="share-url" readonly="readonly">
    <div id="share-copy">Copy link</div>
  </div>
  <div id="sign">
    <div id="sign-nav">
      <span>Sign In Cool Map</span>
      <img src="/static/supa-mapus/assets/close-button.svg" id="close-sign">
    </div>
    <label class="cursor-label">Email
      <input id="email" type="email" list="emaillist" placeholder="输入email：123@qq.com">
      <datalist id="emaillist">
        <option>123@qq.com</option>
        <option>223@qq.com</option>
        <option>323@qq.com</option>
        <option>423@qq.com</option>
        <option>523@qq.com</option>
      </datalist>
    </label>
    <label class="cursor-label">Password <input value="123456" id="password" type="password">
    </label>
    <div id="google-signin-2"><img src="/static/supa-mapus/assets/google-logo.svg">Sign</div>
  </div>
  <div id="popup">
    <div class="header-text">Welcome to Mapus!</div>
    <div class="subheader-text">To get started, click below to sign in with Google.</div>
    <div class="section" id="annotations-section">
      <div id="room-list"></div>
    </div>
    <div id="google-signin" name="test" class="create-map"><img src="/static/supa-mapus/assets/google-logo.svg"> Sign in with Google</div>
  </div>
  <div id="chooseTileZoom">
    <div id="sign-nav">
      <span>Choose Tile Zoom</span>
      <img src="/static/supa-mapus/assets/close-button.svg" id="close-choosetilezoom">
    </div>
    <label class="cursor-label">选择下载级别
      <input id="tilezoom" type="text" list="zoomlist" placeholder="选择下载级别">
      <datalist id="zoomlist">
        <option>10</option>
        <option>12</option>
        <option>13</option>
        <option>14</option>
        <option>15</option>
        <option>16</option>
        <option>17</option>
        <option>18</option>
        <option>19</option>
      </datalist>
    </label>
    <div id="draw-rectangle"><img src="/static/supa-mapus/assets/google-logo.svg">框选范围</div>
  </div>
  <div id="overlay"></div>
  <div id="more-menu">
    <div class="more-item" id="geojson">Export to GeoJSON</div>
    <div class="more-item" id="importgeojson">Import GeoJSON File</div>
    <div class="more-item" id="xmltogeojson">Xml To GeoJSON File</div>
    <div class="more-item" id="downloadmap">Download BingMap</div>
    <div class="more-item" id="share-button">Share</div>
    <div class="more-item" id="sign-button">Sign</div>
    <div class="more-item" id="clear-button">Clear</div>
    <a href="https://github.com/alyssaxuu/mapus" target="_blank" class="more-item">GitHub repo</a>
    <a href="https://zsj.itdos.net/docs/supa-mapus" target="_blank" class="more-item">About</a>
    <div class="more-item" id="logout">Log out</div>
  </div>
  <div id="sidebar">
    <div id="map-details" class="section">
      <input id="map-name" value="Cool map 👻" disabled>
      <input id="map-description" value="Let's all collaborate here">
      <div id="more-vertical">
        <img src="/static/supa-mapus/assets/more-vertical.svg">
      </div>
    </div>
    <!--     <div class="section">
      <div class="section-name">Find nearby</div>
      <table>
        <tr>
          <th class="find-nearby" data-type="supermarket" data-color="#5EBE86" data-others="convenience,deli,organic,markerplace">
            <img src="/static/supa-mapus/assets/groceries-button.svg"><br>
            Groceries
          </th>
          <th class="find-nearby" data-type="fashion" data-color="#A564D2" data-others="beauty,art,bicycle,books,carpet,clothes,computer,cosmetics,department_store,electronics,fashion,florist,furniture,garden_centre,general,gift,hardware,jewelry,kiosk,mall,music,shoes,shopping_centre,sports,stationery,toys">
            <img src="/static/supa-mapus/assets/shopping-button.svg"><br>
            Shopping
          </th>
          <th class="find-nearby" data-type="restaurant" data-color="#4890E8" data-others="bar,fast-food,seafood,food,organic,deli,confectionery,bakery">
            <img src="/static/supa-mapus/assets/food-button.svg"><br>
            Food
          </th>
          <th class="find-nearby" data-type="bar" data-color="#F9D458" data-others="beverages,wine,pub,cafe">
            <img src="/static/supa-mapus/assets/drinks-button.svg"><br>
            Drinks
          </th>
        </tr>
        <tr>
          <th class="find-nearby" data-type="atm" data-color="#634FF1" data-others="bank,coworking,embassy,library,police,post_box,post_office">
            <img src="/static/supa-mapus/assets/services-button.svg"><br>
            Services
          </th>
          <th class="find-nearby" data-type="hospital" data-color="#E15F59" data-others="pharmacy,massage,optician,salon,hairdresser,clinic,dentist,doctors,gym">
            <img src="/static/supa-mapus/assets/health-button.svg"><br>
            Health
          </th>
          <th class="find-nearby" data-type="hotel" data-color="#AC6C48" data-others="chalet,camp_site,caravan_site,guest_house,hostel,motel">
            <img src="/static/supa-mapus/assets/hotels-button.svg"><br>
            Hotels
          </th>
          <th class="find-nearby" data-type="station" data-color="#718390">
            <img src="/static/supa-mapus/assets/transport-button.svg"><br>
            Transport
          </th>
        </tr>
      </table>
    </div> -->
    <div class="section" id="annotations-section">
      <div id="annotations-header">
        <div class="section-name">Annotations</div>
        <div id="hide-annotations">Hide all</div>
      </div>
      <div id="annotations-list">
      </div>
    </div>
    <div class="section copyright-bottom" id="attribution-section">
      <div class="section-name">Made by Alyssa X &3xxx</div>
      <!-- <div id="attribution">© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors</div> -->
      <div id="attribution">© <a href="https://www.microsoft.com/en-us/maps" target="_blank">Bing Maps</a> contributors</div>
    </div>
  </div>
  <span class="toggle-icon" id="icon-close">
    <svg t="1667393698047" class="icon" viewBox="0 0 1138 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4615" width="200" height="30">
      <path d="M0 1024 0 910.222222 1137.777778 910.222222 1137.777778 1024 0 1024ZM0 455.111111 1137.777778 455.111111 1137.777778 568.888889 0 568.888889 0 455.111111ZM0 0 1137.777778 0 1137.777778 113.777778 0 113.777778 0 0Z" p-id="4616"></path>
    </svg>
  </span>
  <div id="search-box">
    <input id="search-input" placeholder="Search for a place" />
    <img src="/static/supa-mapus/assets/search-icon.svg">
  </div>
  <div id="drawing-controls" class="noselect">
    <div id="cursor-tool" class="tool tool-active">
      <img src="/static/supa-mapus/assets/cursor-tool.svg">
    </div>
    <div id="pen-tool" class="tool">
      <img src="/static/supa-mapus/assets/pen-tool.svg">
    </div>
    <div id="eraser-tool" class="tool">
      <img src="/static/supa-mapus/assets/eraser-tool.svg">
    </div>
    <div id="marker-tool" class="tool">
      <img src="/static/supa-mapus/assets/marker-tool.svg">
    </div>
    <div id="path-tool" class="tool">
      <img src="/static/supa-mapus/assets/path-tool.svg">
    </div>
    <div id="rectangle-tool" class="tool">
      <img src="/static/supa-mapus/assets/rectangle-tool.svg">
    </div>
    <div id="area-tool" class="tool">
      <img src="/static/supa-mapus/assets/area-tool.svg">
    </div>
    <div id="circle-tool" class="tool">
      <img src="/static/supa-mapus/assets/circle-tool.svg">
    </div>
    <div id="text-tool" class="tool">
      <img src="/static/supa-mapus/assets/text-tool.svg">
    </div>
    <div id="edit-tool" class="tool">
      <img src="/static/supa-mapus/assets/edit-tool.svg">
    </div>
    <div id="drag-tool" class="tool">
      <img src="/static/supa-mapus/assets/drag-tool.svg">
    </div>
    <div id="rotate-tool" class="tool">
      <img src="/static/supa-mapus/assets/rotate-tool.svg">
    </div>
    <div id="offset-tool" class="tool">
      <img src="/static/supa-mapus/assets/offset-tool.svg">
    </div>
    <div id="profile-tool" class="tool">
      <img src="/static/supa-mapus/assets/profile-tool.svg">
    </div>
    <!-- 超级神奇，下面id用navigation-tool的话，就一直闪动，改为navi-tool好了 -->
    <div id="navi-tool" class="tool">
      <img src="/static/supa-mapus/assets/marker.svg">
    </div>
    <div id="color-picker">
      <div id="inner-color"></div>
      <div id="color-list">
        <div class="color" id="color1" data-color="#E15F59"></div>
        <div class="color" id="color2" data-color="#F29F51"></div>
        <div class="color" id="color3" data-color="#F9D458"></div>
        <div class="color" id="color4" data-color="#5EBE86"></div>
        <div class="color" id="color5" data-color="#4890E8"></div>
        <div class="color" id="color6" data-color="#634FF1"></div>
        <div class="color" id="color7" data-color="#A564D2"></div>
        <div class="color" id="color8" data-color="#222222"></div>
      </div>
    </div>
  </div>
  <div id="hidden-tool">
    <img src="/static/supa-mapus/assets/tool.svg">
  </div>
  <div id="location-control">
    <img src="/static/supa-mapus/assets/location-icon.svg">
  </div>
  <div id="zoom-controls" class="noselect">
    <div id="zoom-in"><img src="/static/supa-mapus/assets/zoomin.svg"></div>
    <div id="zoom-out"><img src="/static/supa-mapus/assets/zoomout.svg"></div>
  </div>
  <div id="outline">
    <div id="observing-name"></div>
  </div>
  <div id="mapDiv"></div>
  <!-- 首先引入supabase客户端，这里采用cdn引入 -->
  <!-- <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> -->
  <script src="/static/js/jquery-3.5.1.min.js"></script>
  <script src="/static/supa-mapus/supabase-js2.js"></script>
    <!-- <script src="https://unpkg.com/@supabase/supabase-js@2"></script> -->
  
  <!-- <script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script> -->
  <script>
  // 然后把url和秘钥复制进去可以进行数据库链接
  const { createClient } = supabase
  // const _supabase = createClient('url', 'anon_key')
  // const _supabase = createClient('https://ccuon0a5g6h3ij26oli0.baseapi.memfiredb.com', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImV4cCI6MzIwMjg5Nzg1MiwiaWF0IjoxNjY0OTc3ODUyLCJpc3MiOiJzdXBhYmFzZSJ9.AeqPG73OPjekOxpCak8XBBAqP-wSk57XVQAmuUYq3C4')
  const _supabase = createClient('https://gsglmaiuplauvkfjalkg.supabase.co', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImdzZ2xtYWl1cGxhdXZrZmphbGtnIiwicm9sZSI6ImFub24iLCJpYXQiOjE2NjUwOTgxMjQsImV4cCI6MTk4MDY3NDEyNH0.wDlCSjtYZkGj9AhCSyIIfUbzYzOAF9_4hKKeEIi9PyE')
  // 就可以进行数据库api操作了
  window.onload = async function() {
    // 查询
    // const { data, error } = await _supabase
    // .from('userdemo')
    // .select(`
    //   id,
    //   name
    // `)
    // console.log('data', data)

    // realtime
    // _supabase
    // .channel('*')
    // .on('postgres_changes', { event: '*', schema: '*' }, payload => {
    //   console.log('Change received!', payload)
    // })
    // .subscribe()
  }
  </script>
  <!-- <script src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js" integrity="sha256-WBkoXOwTeyKclOHuWtc+i2uENFpDZ9YPdf5Hf+D7ewM=" crossorigin=""></script> -->
  <!-- <script src="https://cdn.bootcdn.net/ajax/libs/leaflet/1.9.3/leaflet.js"></script> -->
  <script src="/static/supa-mapus/leaflet.js" crossorigin=""></script>
  <script src="https://cdn.bootcss.com/proj4js/2.4.3/proj4.js"></script>
  <script src="https://cdn.bootcss.com/proj4leaflet/1.0.1/proj4leaflet.min.js"></script>
  <!-- <script src='https://unpkg.com/@turf/turf@6/turf.min.js'></script> -->
  <script src='/static/supa-mapus/turf.min.js'></script>
  <!-- <script src='/static/supa-mapus/turf.min.js'></script> -->
  <!-- <script src="https://unpkg.com/@geoman-io/leaflet-geoman-free@latest/dist/leaflet-geoman.min.js"></script> -->
  <script src="/static/supa-mapus/leaflet-geoman.min.js"></script>

  <script src="https://cdn.bootcss.com/proj4js/2.4.3/proj4.js"></script>
  <script src="https://cdn.bootcss.com/proj4leaflet/1.0.1/proj4leaflet.min.js"></script>
  <!-- <script src="https://unpkg.com/gcoord@0.3.2/dist/gcoord.js"></script> -->
  <script src="/static/supa-mapus/gcoord.js"></script>

  <script src="/static/supa-mapus/leaflet-bing-layer.js"></script>
  <script src="/static/supa-mapus/leaflet.measure.js"></script>
  <script src="/static/supa-mapus/bingdownload.js"></script>
  <!-- <script src="https://unpkg.com/regenerator-runtime"></script> -->
  <script src="/static/supa-mapus/runtime.js"></script>
  <!-- <script src="https://unpkg.com/leaflet-topography"></script> -->
  <script src="/static/supa-mapus/leaflet-topography.js"></script>
  <!-- <script src="https://unpkg.com/@raruto/leaflet-elevation@2.2.8/dist/leaflet-elevation.min.js"></script> -->
  <script src="/static/supa-mapus/leaflet-elevation.min.js"></script>
  <script src="/static/supa-mapus/main-shen6.js"></script>
  <script src="/static/supa-mapus/layer/layer.js"></script> 
  <!-- <script src="/static/supa-mapus/main-shen3.min.js"></script> -->
  <script>
  // 隐藏侧栏
  function init() {
    if (window.navigator.userAgent.match(/mobile/i)) {
      document.getElementById('icon-close').classList.add('icon-mobile')
    }
    document.getElementById('icon-close').addEventListener('click', (e) => {
      if (window.getComputedStyle(document.getElementById('mapDiv')).left === '0px') {
        document.getElementById('icon-close').classList.remove('trans')
        document.getElementById('icon-close').classList.add('trans-revert')
        document.getElementById('mapDiv').style.left = '338px'
        document.getElementById('mapDiv').style.wisdth = 'calc(100% - 338px);'
      } else {
        document.getElementById('icon-close').classList.add('trans')
        document.getElementById('icon-close').classList.remove('trans-revert')
        document.getElementById('mapDiv').style.left = 0
        document.getElementById('mapDiv').style.width = '100%'
      }
    })
    setTimeout(() => {
      document.getElementById('icon-close').click()
    }, 200);
  }
  init()

  // 手机浏览器通过JavaScript调用百度app导航
  /**
   * 浏览器去导航
   * @param target_lng 目标点经度
   * @param target_lat 目标点纬度
   */
  function H5Navigation(target_lng, target_lat) {
    var self = this;
    //起点经度
    this.start_lng = 0;
    //起点纬度
    this.start_lat = 0;
    //目标经度
    this.target_lng = target_lng;
    //目标纬度
    this.target_lat = target_lat;
    //获取定位
    this.getLocation = function() {
      var options = {
        enableHighAccuracy: true,
        maximumAge: 1000
      }
      if (navigator.geolocation) {
        //浏览器支持geolocation
        navigator.geolocation.getCurrentPosition(self.onSuccessLocation, self.onErrorLocation, options);
      } else {
        //浏览器不支持geolocation
        alert('您的浏览器不支持地理位置定位');
      }
    }

    //成功时
    this.onSuccessLocation = function(position) {
      //返回用户位置 这里获得的坐标为WGS84坐标
      //经度
      self.start_lng = position.coords.longitude;//113.2;
      // self.start_lng = 113.2;
      //纬度
      self.start_lat = position.coords.latitude;// 23.1;
      // self.start_lat = 23.1;
      // alert('经度'+self.start_lng+'，纬度'+self.start_lat);
      //调用百度地图导航
      // openClient();
      toBaidu(self.start_lng, self.start_lat, self.target_lng, self.target_lat);
    }

    //失败时
    this.onErrorLocation = function(error) {
      switch (error.code) {
        case 1:
          alert("位置服务被拒绝");
          break;
        case 2:
          alert("暂时获取不到位置信息");
          break;
        case 3:
          alert("获取信息超时");
          break;
        case 4:
          alert("未知错误");
          break;
      }
    }
  }

  var baiduConfig = {
    scheme_Android: 'bdapp',
    scheme_IOS: 'baidumap',
    scheme_web: 'http'
  };

  // 判断操作系统，返回百度的不同操作系统下的接口
  function adjustOS() {
    var ua = window.navigator.userAgent.toLowerCase();
    return (ua.indexOf('os') > 0) ? baiduConfig.scheme_IOS : baiduConfig.scheme_Android
  }

  /**
   * 去百度地图进行导航
   * @param start_lng 起点经度
   * @param start_lat 起点纬度
   * @param target_lng 目标点经度
   * @param target_lng 目标点经度
   */
  function toBaidu(start_lng, start_lat, target_lng, target_lat) {
    //坐标转换 调用后台API 将WGS84坐标转换为百度的BD09坐标
    $.get("", { "lng": start_lng, "lat": start_lat, "from": "1", "to": "5" }, function(data) {
      var start_bd09_lng = start_lng;
      var start_bd09_lat = start_lat;
      //调起百度进行导航
      // location.href = "http://api.map.baidu.com/direction?origin=latlng:" + start_bd09_lat + "," + start_bd09_lng + "|name:我的位置&destination=" + target_lat + "," + target_lng + "&mode=driving&region=中国&output=html&src=webapp.demo.location";
      // Intent i1 = new Intent();
      // 驾车路线规划
      // i1.setData(Uri.parse("baidumap://map/direction?origin=" + start_bd09_lat + "," + start_bd09_lng + "&destination=" + target_lat + "," + target_lng + "&coord_type=wgs84&mode=driving&src=andr.baidu.openAPIdemo"));
      // startActivity(i1);
      // 巨坑：不支持“|name:我的位置”，我的位置——应该是准确的自己所在位置的名称
      var src = adjustOS();
      if (src == "baidumap") {
        location.href = "baidumap://map/direction?origin=" + start_bd09_lat + "," + start_bd09_lng + "&destination=" + target_lat + "," + target_lng + "&coord_type=wgs84&mode=driving&src=ios.baidu.openAPIdemo"
      } else if (src == "bdapp") {
        location.href = "bdapp://map/direction?origin=" + start_bd09_lat + "," + start_bd09_lng + "&destination=" + target_lat + "," + target_lng + "&coord_type=wgs84&mode=driving&src=andr.baidu.openAPIdemo"
      } else {
        location.href = "http://api.map.baidu.com/direction?origin=latlng:" + start_bd09_lat + "," + start_bd09_lng + "&destination=" + target_lat + "," + target_lng + "&mode=driving&region=中国&output=html&src=webapp.demo.location";
      }
    })
  }

  /**
   * 调用示例
   */
  function goNavigation(lat, lng) {
    // const lat = 23.125178;
    // const lon = 113.280637;
    var target_lng = lng; //113.280637; //"目标点经度 WGS84坐标";
    // var target_lng = 113.280637;
    var target_lat = lat; //23.125178; //"目标点纬度 WGS84坐标";
    // var target_lat = 23.125178;
    //浏览器端去导航
    new H5Navigation(target_lng, target_lat).getLocation();
  }

  // http://api.map.baidu.com/direction?origin=latlng:34.264642646862,108.95108518068|name:我家&destination=大雁塔&mode=driving&region=西安&output=html&src=webapp.baidu.openAPIdemo

  // https://lbsyun.baidu.com/index.php?title=uri参考说明
  //调起百度PC或Web地图，展示"西安市"从（lat:34.264642646862,lng:108.95108518068 ）"我家"到"大雁塔"的驾车路线。
  // //网页应用调起Android百度地图方式举例
  // <a href="bdapp://map/direction?region=beijing&origin=39.98871,
  // 116.43234&destination=西直门&coord_type=bd09ll&mode=driving&src=andr.baidu.openAPIdemo">驾车路线规划</a>
  //网页应用调起Android百度地图方式举例
  // <a href="bdapp://map/direction?region=beijing&origin=39.98871,
  // 116.43234&destination=40.057406655722,116.2964407172&coord_type=bd09ll&mode=walking&src=andr.baidu.openAPIdemo">步行路线规划</a>
  // 调用ios百度线路规划
  // <a href="baidumap://map/direction?origin=34.264642646862,108.95108518068&destination=40.007623,116.360582&coord_type=bd09ll&mode=driving&src=ios.baidu.openAPIdemo">路线规划</a>
  // 另外一种实现

  // var baiduConfig = {
  //   scheme_Android: 'bdapp://map/marker?location=' + fdata.baiduGpsLat + ',' + fdata.baiduGpsLog + '&title=' + fdata.name + '&content=' + fdata.address,
  //   scheme_IOS: 'baidumap://map/marker?location=' + fdata.baiduGpsLat + ',' + fdata.baiduGpsLog + '&title=' + fdata.name + '&content=' + fdata.address,
  //   scheme_web: 'http://api.map.baidu.com/marker?location=' + fdata.baiduGpsLat + ',' + fdata.baiduGpsLog + '&title=' + fdata.name + '&content=' + fdata.address + '&output=html'
  // };
  // var timeout = 600;
  // // 判断操作系统，返回百度的不同操作系统下的接口
  // function adjustOS() {
  //   var ua = window.navigator.userAgent.toLowerCase();
  //   return (ua.indexOf('os') > 0) ? baiduConfig.scheme_IOS : baiduConfig.scheme_Android
  // }

  // function openClient() {
  //   var startTime = Date.now();
  //   var ifr = document.createElement('iframe');
  //   ifr.src = adjustOS();
  //   ifr.style.display = 'none';
  //   document.body.appendChild(ifr);
  //   var t = setTimeout(function() {
  //     var endTime = Date.now();
  //     if (!startTime || endTime - startTime < timeout + 200) {
  //       window.location.href = baiduConfig.scheme_web;
  //     }
  //   }, timeout);
  //   window.onblur = function() {
  //     clearTimeout(t);
  //   }
  // }
  </script>
</body>

</html>